<?php
/*-----------------------------------------------------------------------------------*/
/* Start theme Functions - Please refrain from editing this file */
/*-----------------------------------------------------------------------------------*/
$admin_path = TEMPLATEPATH . '/admin-functions/';
$include_path = TEMPLATEPATH . '/stInclude/';

require_once $include_path. '/libs/classes/stadmincontroller.php';

require_once $admin_path. 'controller.php';
require_once $admin_path. 'hook.php';
require_once $admin_path. 'functions.php';
require_once $admin_path. 'plugins.php';

$config = include $include_path. '/config.php';

$controllerName = $config['theme_name'] . "Controller";
$controllerObject = new $controllerName($config);
$method = array($controllerObject, 'addAdmin');
add_action( 'admin_menu', $method);

if (is_admin() && isset($_GET['activated']) && $pagenow == "themes.php") {
    header('Location: ' . admin_url() . 'admin.php?page='.$config['theme_name']);
    $controllerObject->activationTheme();
}

// Add hook function
$hook = new hook($config);

?>